//

#ifndef _GAMEVIEW_HPP
#define _GAMEVIEW_HPP

#include "base.hpp"
#include "renderer.hpp"

using namespace wtk;

class RenderEngine;
class Game;
class NDataCamera;



// GameView
//
class GameView :public wtk::Dialog
{
  struct CameraControl
  {
    NDataCamera *camera{};
    int pitch{};
    int yaw{};
    int zoom{};
  };
  
private:
  RenderEngine &engine;
  Game &game;

  Renderer renderer;

  RenderModeID render_mode{0};
  int render_mode_count{0};

  static constexpr int n_cameras = 2;
  int active_cam{0};
  CameraControl cam[n_cameras]{};
  
  uint64_t frame_count{0};

  void move_camera ( int x,
                     int y );
  
public:
  GameView ( wtk::Display &display,
             RenderEngine &engine,
             Game &game );
  
  virtual void event_keyboard ( const Event &event );
  virtual void event_mouse ( const Event &event );
  virtual void draw ( const DrawContext &context );
};

#endif
